package com.zhangyang.server;

import java.io.FileOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.UUID;

/**
 * Created by ASUS on 2017/10/19.
 */
public class BioClient {
    private int port;
    public BioClient(int port) {
        this.port = port;
    }

    public void listen(){
        try {
            Socket socket=new Socket("localhost",port);
            FileOutputStream fileOutputStream=(FileOutputStream) socket.getOutputStream();
            UUID uuid=UUID.randomUUID();
            fileOutputStream.write(uuid.toString().getBytes());
            fileOutputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        for (int i=0;i<100;++i) {
            new BioClient(8080).listen();
        }
    }
}
